package com.summer.internet;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressTest {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress inet1 = InetAddress.getByName("192.168.3.21");
        System.out.println(inet1);
        InetAddress inet2 = InetAddress.getByName("www.ishowcode.top");
        System.out.println(inet2);
        InetAddress inet3 = InetAddress.getLocalHost();
        System.out.println(inet3);
        System.out.println(inet2.getHostName());
        System.out.println(inet2.getHostAddress());
    }
}
